package com.runvp.service.biz.service.impl;

import java.util.List;
import com.runvp.common.utils.DateUtils;
import com.runvp.common.utils.ShiroUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.runvp.service.biz.mapper.BizRechargePackageMapper;
import com.runvp.service.biz.domain.BizRechargePackage;
import com.runvp.service.biz.service.IBizRechargePackageService;
import com.runvp.common.core.text.Convert;

/**
 * 充值套餐Service业务层处理
 * 
 * @author runvp
 * @date 2022-09-18
 */
@Service
public class BizRechargePackageServiceImpl implements IBizRechargePackageService {
    @Autowired
    private BizRechargePackageMapper bizRechargePackageMapper;

    /**
     * 查询充值套餐
     * 
     * @param id 充值套餐主键
     * @return 充值套餐
     */
    @Override
    public BizRechargePackage selectBizRechargePackageById(Long id) {
        return bizRechargePackageMapper.selectBizRechargePackageById(id);
    }

    /**
     * 查询充值套餐列表
     * 
     * @param bizRechargePackage 充值套餐
     * @return 充值套餐
     */
    @Override
    public List<BizRechargePackage> selectBizRechargePackageList(BizRechargePackage bizRechargePackage) {
        return bizRechargePackageMapper.selectBizRechargePackageList(bizRechargePackage);
    }

    /**
     * 新增充值套餐
     * 
     * @param bizRechargePackage 充值套餐
     * @return 结果
     */
    @Override
    public int insertBizRechargePackage(BizRechargePackage bizRechargePackage) {
        bizRechargePackage.setCreateTime(DateUtils.getNowDate());
        bizRechargePackage.setCreateBy(ShiroUtils.getLoginName());
        return bizRechargePackageMapper.insertBizRechargePackage(bizRechargePackage);
    }

    /**
     * 修改充值套餐
     * 
     * @param bizRechargePackage 充值套餐
     * @return 结果
     */
    @Override
    public int updateBizRechargePackage(BizRechargePackage bizRechargePackage) {
        bizRechargePackage.setUpdateTime(DateUtils.getNowDate());
        bizRechargePackage.setUpdateBy(ShiroUtils.getLoginName());
        return bizRechargePackageMapper.updateBizRechargePackage(bizRechargePackage);
    }

    /**
     * 批量删除充值套餐
     * 
     * @param ids 需要删除的充值套餐主键
     * @return 结果
     */
    @Override
    public int deleteBizRechargePackageByIds(String ids) {
        return bizRechargePackageMapper.deleteBizRechargePackageByIds(Convert.toStrArray(ids));
    }

    /**
     * 删除充值套餐信息
     * 
     * @param id 充值套餐主键
     * @return 结果
     */
    @Override
    public int deleteBizRechargePackageById(Long id) {
        return bizRechargePackageMapper.deleteBizRechargePackageById(id);
    }
}
